@include('admin.header')

<style type="text/css">
  .opartion {
    width: 350px;
  }

  .pagination {
    list-style: none;
    float: right;
  }

  .pagination li {
    float: left;
    padding-left: 5px;
    padding-right: 5px;
  }
</style>

<div class="wrap">
  <div class="margin-bottom-20">
    <!-- <a class="btn btn-primary edit"><i class="fa fa-plus"></i> 添加</a> -->
  </div>
  <form class="form-horizontal js-ajax-form" method="post" novalidate="novalidate">
    <table class="table table-hover table-bordered">
      <thead>
      <tr>
        <th width="100">用户ID号</th>
        <th>用户账号</th>
        <th>用户名</th>
        <th>推荐人</th>
        <th>手机号码</th>
        <th>用户级别</th>
        <th>录入时间</th>
        <th>实名验证时间</th>
        <th class="opartion">操作</th>
      </tr>
      </thead>
      <tbody>

      @foreach($user_info as $user)
      <tr>
        <td>{{$user->nodeid}}</td>
        <td>{{$user->nodecode}}</td>
        <td>{{$user->nodename}}</td>
        <td>
          @if($user->parent_name == '')
            暂无
          @else
            {{$user->parent_name}}
          @endif
        </td>
        <td>
          @if(is_null($user->mobileno))
            暂无
          @else
            {{$user->mobileno}}
          @endif
        </td>
        <td>{{$user->nodelevel}}</td>
        <td>{{$user->createtime}}</td>
        <td>
          @if(is_null($user->authtime))
            未实名验证
          @else
            {{$user->authtime}}
          @endif
        </td>
        <td>
          <a class="vip" _id="{{$user->nodeid}}" nodename="{{$user->nodename}}">VIP套餐</a>|
          <a class="direct" _id="{{$user->nodeid}}" nodename="{{$user->nodename}}">直销套餐</a>|
          <a class="purse" _id="{{$user->nodeid}}">钱包余额</a>|
          <a class="on_line" _id="{{$user->nodeid}}" nodename="{{$user->nodename}}">线上订单</a>|
          <a class="ucenter_details" _id="{{$user->nodeid}}">详情</a>|
          <a class="sub_direct">用户关系</a>
        </td>
      </tr>
      @endforeach
      </tbody>
    </table>

    <!-- 分页 -->
    @if (!empty($user_info))
    <div class="page_list">
        {{$user_info->links()}}
    </div>
    @endif
  </form>
</div>

<script>
  $(function(){
    //VIP套餐
  	$('.vip').click(function(){
  		var id = $(this).attr('_id') || 0;
      var nodename = $(this).attr('nodename');
	    open_iframe_layer('/ucenter/ucenter_vip_cost?id='+id+'&nodename='+nodename);
    });

    //直销套餐
    $('a[class="direct"]').click(function(){
      var id = $(this).attr('_id');
      var nodename = $(this).attr('nodename');
      open_iframe_layer('/ucenter/ucenter_direct_cost?id='+id+'&nodename='+nodename);
    });

    //线上订单
    $('.on_line').click(function(){
      var id = $(this).attr('_id');
      var nodename = $(this).attr('nodename');
      open_iframe_layer('/ucenter/ucenter_online_order?id='+id+'&nodename='+nodename);
    });

    //用户详情
    $('.ucenter_details').click(function() {
      var id = $(this).attr('_id');
      open_iframe_layer('/ucenter/ucenter_details?id='+id);
    });

    //用户详情
    $('.purse').click(function() {
      var id = $(this).attr('_id');
      open_iframe_layer('/ucenter/ucenter_purse?id='+id);
    });
  });
</script>